function [data_random] = iris_read(file_txt)
    % 读取Iris数据集文件
    fid = fopen(file_txt, 'rt');
    
    % 初始化存储数组
    features = [];
    labels = {};
    species_mapping = containers.Map();
    
    % 逐行读取数据
    while ~feof(fid)
        line = fgetl(fid);
        if isempty(line)
            continue;  % 跳过空行
        end
        
        % 分割逗号分隔的数据
        parts = strsplit(line, ',');
        
        % 提取特征值（前4列）
        feature_vector = str2double(parts(1:4));
        features = [features; feature_vector];
        
        % 提取标签（第5列）
        label_str = parts{5};
        labels = [labels; label_str];
        
        % 记录所有类别
        if ~isKey(species_mapping, label_str)
            species_mapping(label_str) = length(species_mapping) + 1;
        end
    end
    fclose(fid);
    
    % 将字符串标签转换为数值编码
    num_labels = zeros(length(labels), 1);
    for i = 1:length(labels)
        num_labels(i) = species_mapping(labels{i});
    end
    
    % 合并标签和特征
    data_combined = [num_labels, features];
    
    % 获取数据集信息
    num_samples = size(data_combined, 1);
    num_features = size(features, 2);
    
    % 显示数据集统计信息
    fprintf('成功读取Iris数据集: %s\n', file_txt);
    fprintf('样本数量: %d\n', num_samples);
    fprintf('特征数量: %d\n', num_features);
    
    % 显示类别分布
    fprintf('\n类别分布:\n');
    species_names = keys(species_mapping);
    for i = 1:length(species_names)
        species = species_names{i};
        count = sum(strcmp(labels, species));
        percent = (count / num_samples) * 100;
        fprintf('  %-15s: %d (%.1f%%)\n', species, count, percent);
    end
    
    % 显示特征摘要统计
    fprintf('\n特征摘要统计:\n');
    feat_names = {'Sepal Length', 'Sepal Width', 'Petal Length', 'Petal Width'};
    fprintf('%-15s %5s %5s %7s %7s\n', 'Feature', 'Min', 'Max', 'Mean', 'Std');
    for i = 1:num_features
        col = features(:, i);
        fprintf('%-15s %5.2f %5.2f %7.2f %7.2f\n', ...
                feat_names{i}, min(col), max(col), mean(col), std(col));
    end
    
    % 随机打乱数据
    random_indices = randperm(size(data_combined, 1));
    data_random = data_combined(random_indices, :);
end